package com.bestcem.xm.label.grpc.service.param.label;

import com.bestcem.xm.common.core.constant.RegTypes;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import static com.bestcem.xm.label.constant.Constants.LABEL_NAME_MAX_LEN;

/**
 * 标签是否重名参数校验
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/7/2
 */

@Getter
@Setter
public class CheckLabelNameParam {

    @NotBlank(message = "组织id不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "标签id格式错误")
    private String orgId;

    @NotNull(message = "联系人类型不能为空")
    private Integer attribute;

    @NotBlank(message = "标签名称不能为空")
    @Size(max = LABEL_NAME_MAX_LEN, message = "标签名称长度不能超过30")
    private String name;
}
